import Cookies from 'js-cookie'

const TokenKey = 'hmmm_token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

const TimeKey = 'hmmm_timestamp_key'

//! 用户登录完成后把当前的时间戳记录下来，相当于token开始计时
export function setTimeStamp() {
  return Cookies.set(TimeKey, Date.now())
}

export function getTimeStamp() {
  return Cookies.get(TimeKey)
}
